package org.sun.web.io;

import java.io.File;
import java.io.IOException;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FileReadAndWrite {

	//private final static Logger Log=LoggerFactory.getLogger(FileReadAndWrite.class);
	public static void writeFile(){
		String name="test.js";
		String pkg=FileReadAndWrite.class.getPackage().getName();
		pkg=pkg.replace(".", "/");
		String path=FileReadAndWrite.class.getResource("").getPath();
		System.out.println(path);
		File f=new File(path+name);
		if(!f.exists())
			try {
				f.createNewFile();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		System.out.println(f.getPath());
	}
	
	@Test
	public void test(){
		writeFile();
	}
}
